import request from '@/utils/request'

export function fetchList(query) {
  return request({
    // url: '/vue-element-admin/article/list',
    url: '/admin/paging',
    method: 'get',
    params: query
  })
}
/* 上架歌曲 */
export function fetchUp(query) {
  return request({
    url: '/admin/shelvesSongs',
    method: 'get',
    params: {ids:query}
  })
}

/* 下架歌曲 */
export function fetchDown(query) {
  return request({
    url: '/admin/removeSongs',
    method: 'get',
    params: {ids:query}
  })
}
/* 获取每周的音乐听歌风格 */
export function getWeeklyStyle() {
  return request({
    url: '/admin/getWeeklyStyle',
    method: 'get'
  })
}

/* 增加歌曲资源 */
export function addSongs(data) {
  return request({
    url: '/admin/addSongs',
    method: 'get',
    data
  })
}

/* 获取客户端的举报信息 */
export function getReportInfo() {
  return request({
    url: '/admin/getReportInfo',
    method: 'get'
  })
}

/* 评论举报的撤销操作 */
export function cancelReport(data) {
  return request({
    url: '/admin/revokeReport',
    method: 'get',
    params: {id:data}
  })
}

/* 评论举报的删除操作 */
export function deleteReport(id,commitID) {
  return request({
    url: '/admin/delReportComment',
    method: 'get',
    params: {id:id,commentid:commitID}
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
